﻿using System;
using System.Collections.Generic;
using System.Text;

using System.Diagnostics;

namespace ElteIk.RoboSoccer.DavidTactics
{
    class ActionList : List<IAction>, IAction
    {
        public void Do()
        {
            if (Count > 0)
            {
                IAction first = this[0];
                if (first.HasEnded())
                {
                    Debug.Write("X");
                    RemoveAt(0);
                }
                else
                    first.Do();
            }
        }

        public bool HasEnded()
        {
            return Count == 0;
        }
    }
}
